<template>
	<view class="content">
		<view class="img">
			<image src="../../static/index/company_bg.png" mode="widthFix"></image>
		</view>
		<view class="row" @click="$public.navTo('public/urgent')">
			<view class="col-12">
				紧急联系人
			</view>
			<view class="col-10 t_right">
				{{status}}
			</view>
			<view class="col-2">
				<text class="iconfont icon-youjiantou"></text>
			</view>
		</view>
		<view class="btn">
			<button type="primary" @click="$public.navTo('public/security2')">一键报警</button>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				objPage:{
					pageNum: 1,
					pageSize: 10
				},
				loading: true,
				status: '未设置'
			}
		},
		onShow() {
			this.load();
		},
		methods:{
			async load(){
				if(!this.loading){
					return
				}
				let res = await this.$api.request(this.$api.public.getlist,this.objPage);
				if(res.list.length != 0){
					this.status = '已设置';
				}
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #f5f5f5;
	}
	.img{
		width: 100%;
		image{
			width: 100%;
		}
	}
	.row{
		width: 92%;
		padding: 0 4%;
		height: 96rpx;
		line-height: 96rpx;
		background-color: #FFFFFF;
		.col-12{
			color: #333333;
		}
		.col-10,
		.col-2{
			color: #B3B3B3;
		}
	}
	.btn{
		width: 92%;
		padding: 0 4%;
		margin-top: 40rpx;
		button{
			height: 96rpx;
			line-height: 96rpx;
			border-radius: 48rpx;
			background-color: #6CBF30;
		}
	}
</style>
